package com.googlecode.stemwijzer.client.event;

import com.google.gwt.event.shared.GwtEvent;
import com.googlecode.stemwijzer.client.event.handler.NotificationHandler;

public class NotificationEvent extends GwtEvent<NotificationHandler> {

	public static final Type<NotificationHandler> TYPE = new Type<NotificationHandler>();

	private String message;

	public NotificationEvent(final String message) {
		this.message = message;
	}

	@Override
	public Type<NotificationHandler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(NotificationHandler handler) {
		handler.onNotification(this);
	}

	public String getMessage() {
		return message;
	}
}
